// ignore_for_file: unused_local_variable

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_app/main02.dart';
import 'res/listData.dart';

main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Demo'),
        ),
        body: LayoutDemo(),
      ),
    );
  }
}

class LayoutDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Wrap(
      spacing: 10,
      runSpacing: 40,
      direction: Axis.horizontal,
      children: [
        MyButton("text"),
        MyButton("text"),
        MyButton("text"),
        MyButton("text"),
        MyButton("text"),
        MyButton("text"),
        MyButton("texdt"),
        MyButton("texdfdfdfdft"),
        MyButton("texdft"),
        MyButton("texfdfdt"),
        MyButton("tedddxt"),
        MyButton("texdt"),
      ],
    );
  }
}

class MyButton extends StatelessWidget {
  final String? text;

  const MyButton(this.text, {Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      onPressed: () {},
      child: Text(this.text.toString()),
    );
  }
}
